﻿CREATE TABLE [dbo].[tblSequenceStep] (
    [SequenceStepID]     INT      IDENTITY (1, 1) NOT NULL,
    [SequenceID]         INT      NOT NULL,
    [Delay]              SMALLINT NOT NULL,
    [RecurrenceTerm]     SMALLINT NOT NULL,
    [RecurrenceCount]    SMALLINT NOT NULL,
    [PrevSequenceStepID] INT      NULL,
	[Name]				 NVARCHAR(50) NULL,
	[Shipping]			 MONEY NULL,
);
GO
GO;
EXECUTE sp_addextendedproperty @name = N'MS_Description', 
	@value = N'The number of days to delay from the previous step', 
	@level0type = N'SCHEMA', @level0name = N'dbo',
	@level1type = N'TABLE', @level1name = N'tblSequenceStep',
	@level2type = N'COLUMN', @level2name = N'Delay';
GO;
EXECUTE sp_addextendedproperty @name = N'MS_Description', 
	@value = N'The number of days between recurrences of this step', 
	@level0type = N'SCHEMA', @level0name = N'dbo',
	@level1type = N'TABLE', @level1name = N'tblSequenceStep',
	@level2type = N'COLUMN', @level2name = N'RecurrenceTerm';
GO;
EXECUTE sp_addextendedproperty @name = N'MS_Description', 
	@value = N'The number of times the step recurres before continuing to the next step.  Set to 0 if this step is to recur indefinately.', 
	@level0type = N'SCHEMA', @level0name = N'dbo',
	@level1type = N'TABLE', @level1name = N'tblSequenceStep',
	@level2type = N'COLUMN', @level2name = N'RecurrenceCount';
GO;
EXECUTE sp_addextendedproperty @name = N'MS_Description', 
	@value = N'The ID of the previous step', 
	@level0type = N'SCHEMA', @level0name = N'dbo',
	@level1type = N'TABLE', @level1name = N'tblSequenceStep',
	@level2type = N'COLUMN', @level2name = N'PrevSequenceStepID';

